<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ozconv="clr-namespace:OhZeeCreative.Converters;assembly=OhZeeCreative.Silverlight"
    xmlns:radials="clr-namespace:OhZeeCreative.UI.Controls">

    <ozconv:BooleanToVisibilityConverter x:Name="btvConverter"/>
    <Style TargetType="radials:RadialControl">
        <Setter  Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="radials:RadialControl">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid>
                            <Polygon x:Name="arc" Fill="{TemplateBinding Foreground}" Stroke="{TemplateBinding Stroke}" StrokeThickness="{TemplateBinding StrokeThickness}"/>
                            <Line x:Name="crossHairHorizontal" Visibility="{Binding ShowCrosshairsAtOrigin, Converter={StaticResource btvConverter}, RelativeSource={RelativeSource TemplatedParent}}" Stroke="#80808080"  StrokeThickness="1.0"/>
                            <Line x:Name="crossHairVertical"  Visibility="{Binding ShowCrosshairsAtOrigin, Converter={StaticResource btvConverter}, RelativeSource={RelativeSource TemplatedParent}}"  Stroke="#80808080"  StrokeThickness="1.0"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="radials:RadialIndicator">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="radials:RadialIndicator">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Canvas x:Name="container" RenderTransformOrigin="0,0.5" HorizontalAlignment="Center" VerticalAlignment="Center">
                            <Canvas.RenderTransform>
                                <!-- TemplateBinding doesn't seem to work for the transform -->
                                <CompositeTransform 
                                    TranslateX="{Binding OffsetX, RelativeSource={RelativeSource TemplatedParent}}" 
                                    TranslateY="{Binding OffsetY, RelativeSource={RelativeSource TemplatedParent}}"/>
                            </Canvas.RenderTransform>
                            <ContentPresenter x:Name="content" />
                        </Canvas>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="radials:RadialRepeater">

        <Setter  Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="radials:RadialRepeater">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" 
                                  HorizontalAlignment="Center" 
                                  VerticalAlignment="Center" >
                        <radials:RadialLayoutPanel x:Name="rlp" HorizontalAlignment="Center" VerticalAlignment="Center" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Setter Property="ItemTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Rectangle Width="30" Height="30" Fill="Crimson" Stroke="Black" StrokeThickness="3" RenderTransformOrigin="0.5,0.5"/>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="radials:MultiRing">
        <Setter  Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="radials:MultiRing">
                    <Grid x:Name="grid" Background="{TemplateBinding Background}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>        
    </Style>

</ResourceDictionary>
